﻿<Page x:Class="hr_1.View.Edit_employee"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:src="clr-namespace:hr_1"
      mc:Ignorable="d" 
      Title="" Height="Auto" Width="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" d:DesignHeight="462" d:DesignWidth="593" DataContext="{Binding}">
    <Page.Resources>
        <src:HRDataContext x:Key="hrData"/>
    </Page.Resources>
    <Grid>
        <TabControl>
            <TabItem Name="person_info" Header="Общая информация">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <DataGrid HorizontalAlignment="Left" Margin="1,2,0,0" 
                              Name="dataGrid_persons" 
                              VerticalAlignment="Top" Width="Auto" 
                              AutoGenerateColumns="False"  Grid.ColumnSpan="2">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Id" Binding="{Binding personId, Mode=TwoWay}" Width="Auto" Visibility="Hidden" />
                            <DataGridTextColumn Header="Имя" Binding="{Binding firstname, Mode=TwoWay}" Width="Auto"/>
                            <DataGridTextColumn Header="Отчество" Binding="{Binding middlename, Mode=TwoWay}" Width="Auto" />
                            <DataGridTextColumn Header="Фамилия" Binding="{Binding lastname, Mode=TwoWay}" Width="Auto"/>
                            <DataGridTextColumn Header="Дата рождения" Binding="{Binding birthday, Mode=TwoWay}" Width="Auto"/>
                            <DataGridTextColumn Header="Пол" Binding="{Binding sex, Mode=TwoWay}" Width="Auto"/>
                            <DataGridTextColumn Header="Дата приема на работу" Binding="{Binding date_begin_work, Mode=TwoWay}" Width="Auto"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Button Content="Сохранить изменения" HorizontalAlignment="Right" Margin="0,0,104,25" Name="save_change_Click" Width="Auto" Click="Save_Click" Height="23" VerticalAlignment="Bottom" Grid.Column="1" />
                    <Button Content="Отмена" HorizontalAlignment="Right" Margin="0,0,26,25" Name="cancel" Width="Auto" Click="Cancel_Click" Grid.Column="1" Height="23" VerticalAlignment="Bottom" />
                </Grid>
            </TabItem>
            <!--<TabItem Header="Образование и воинский учет">
                        <Grid>
                    <DataGrid Name="dataGrid_edu" AutoGenerateColumns="False" 
                                      Width="Auto" Height="Auto">
                        <DataGrid.Columns>
                                    <DataGridTextColumn Header="Уровень образования" Binding="{Binding Mode=TwoWay, Source={StaticResource hrData}, Path=educations/ed_level}" Width="Auto"/>
                                    <DataGridTextColumn Header="Образовательное учреждение" Binding="{Binding institution, Mode=TwoWay}"/>
                                    <DataGridTextColumn Header="Факультет" Binding="{Binding faculty, Mode=TwoWay}" />
                                    <DataGridTextColumn Header="Специальность" Binding="{Binding speciality, Mode=TwoWay}"/>
                                    <DataGridTextColumn Header="Квалификация" Binding="{Binding qualification, Mode=TwoWay}" />
                                    <DataGridTextColumn Header="Степень" Binding="{Binding degree, Mode=TwoWay}"/>
                                    
                        </DataGrid.Columns>
                            </DataGrid>
                    <DataGrid Name="dataGrid_military" AutoGenerateColumns="False" 
                              Width="Auto" Height="Auto" Margin="0,83,0,-83">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Воинский статус" Binding="{Binding status, Mode=TwoWay}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem Header="Трудовая деятельность">
                <Grid>
                    <DataGrid Name="dataGrid_workActivity" AutoGenerateColumns="False"
                              Width="Auto" Height="Auto">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Номер договора" Binding="{Binding contract, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Должность" Binding="{Binding position, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Подразделение" Binding="{Binding department, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Группа" Binding="{Binding position_group, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Дата приема на работу" Binding="{Binding data_hire, Mode=TwoWay}" />
                            <DataGridTextColumn Header="Дата увольнения" Binding="{Binding datr_dismissal, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Оклад" Binding="{Binding salary, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Ставка" Binding="{Binding rate, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="Стаж" Binding="{Binding experience, Mode=TwoWay}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                   </Grid>
            </TabItem>-->
            <!--<TabItem Name="pos_criterions" Header="Критерии"></TabItem>-->
        </TabControl>
    </Grid>
</Page>
